<include file="common/hearder"/>
<h4><span class="dq  glyphicon glyphicon-user">员工调遣的详情页</span></h4>
<div class="hr"></div>
<div style="margin: 30px 0 0 0;">
    <a class="btn btn-primary glyphicon glyphicon-eye-close" onclick="$('#xs').submit();">批量显示</a>
    <a href="{:U('show')}" class="btn btn-default">返回上一页</a>
</div>
<br>
<form id="xs" action="{:U('xs_all')}">
    <table class="table table-hover table-bordered">
        <thead>
        <th><input class="check_all" type="checkbox"></th>
        <th class="active">编号</th>
        <th class="active">被调员工</th>
        <th class="active">前部门</th>
        <th class="active">现部门</th>
        <th class="active">前岗位</th>
        <th class="active">现岗位</th>
        <th class="active">调离时间</th>
        <th class="active">调离原因</th>
        <th class="active">状态</th>
        <th class="active">操作</th>
        </thead>
        <tbody>
        <foreach name="rec" item="r">
            <tr class="active">
                <td><input class="check_item" type="checkbox" name="rmd_ids[]" value="{$r[rmd_id]}"></td>
                <td>{$r.rmd_id}</td>
                <?php foreach($sta as $s){?>
                <?php if($s['stf_id']==$r['stf_id']){?>
                <td><?php echo $s['stf_name']?></td>
                <td><?php echo $s['dpt_name']?></td>
                <td><?php echo $s['pt_name']?></td>
                <?php }}?>
                <?php foreach($dpt as $d){?>
                <?php if($d['dpt_id']==$r['dpt_aid']){?>
                <td><?php echo $d['dpt_name']?></td>
                <td><?php echo $d['pt_name']?></td>
                <?php }}?>
                <td>{$r.rmd_time}</td>
                <td>{$r.rmd_becase}</td>
                <td style="color: red;">{$r['status']==0?'通过':($r['status']==-1?'驳回':'审核中')}</td>
                <td>
                    <a href="{:U('xs',array('rmd_id'=>$r['rmd_id'],'state'=>$r['state']))}" class="btn btn-link glyphicon glyphicon-eye-open" style="text-decoration: none;">显示</a>
                    <a href="javascript:drop_confirm('确定要删除这条信息吗？','__URL__/delete/rmd_id/{$r.rmd_id}/state/{$r.state}')" class="btn btn-link glyphicon glyphicon-trash">删除</a>
                </td>
            </tr>
        </foreach>
        </tbody>
    </table>
</form>
<div>共 {$count} 条记录</div>
<div class="show_page">{$show}</div>
<style>
    .dq {
        display: block;
        margin-top: 20px;
    }

    .hr {
        margin-bottom: -10px;
        width: 100%;
        height: 1px;
        border: 1px solid #cdcdcd;
    }

    .prev, .next {
        font-size: 12px;
        line-height: 22px;
    }

    .prev, .current, .num, .next {
        display: block;
        width: 44px;
        height: 37px;
        border: 1px solid #ddd;
        text-align: center;
        padding: 7px 12px;
        float: left;
        margin: 0 5px;
    }

    .prev:hover, .num:hover, .next:hover {
        background-color: #ddd;
    }

    .current {
        background-color: #36b1ef;
        color: white;
        border: 1px solid #36b1ef;
    }

    .show_page {
        float: right;
    }
</style>
<script>
    $('.check_all').on('click', function () {
        if ($(this).prop('checked')) {
            $('.check_item').each(function () {
                if ($(this).prop('checked')) {
                    $(this).prop('checked', false);
                } else {
                    $(this).prop('checked', true);
                }
            });
        } else {
            $('.check_item').prop('checked', false);
        }
    });
</script>
<script>
    function drop_confirm(message,pathurl)
    {
        if(confirm(message))
        {
            window.location.href=pathurl;
        }else
        {
            return false;
        }
    }
</script>
<include file="common/footer"/>